package com.bite.spring.demo.Controller;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/calc")
public class CalcController {

    @RequestMapping("/add")
    public String add(Integer num1, Integer num2) {
        // 判断数字是否合法
        if (num1 == null || num2 == null) return "数字不合法";
        return Integer.toString(num1 + num2);
    }
}
